package com.ebt.m.proposal_v2.dao.request;

import com.ebt.m.proposal_v2.base.Constant;
import com.ebt.m.proposal_v2.utils.DataUtils;
import com.ebt.m.commons.utils.Logger;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 获取附加险列表参数
 *
 * @author archer.qi
 *         Created on 2017/5/19.
 */
public class ParamGetRisks implements Serializable {

    /* 主险ID*/
    public int mainProposalID;
    /* 被保人信息*/
    public String age;
    public int sex;
    public int profession;
    public String birthday;

    public int pageIndex = 1;
    public String pageSize = Constant.DEFAULT_PAGE_SIZE + "";

    /**
     * 参数表
     * <p>
     * 1/ 附加险列表
     * <p>
     * 2/ 主险常用产品列表
     *
     * @return
     */
    public Map<String, String> createQueryMap() {
        Logger.i("常用产品参数表： \n"
                + "年龄： " + age + "\n"
                + "生日： " + birthday + "\n"
                + "处理后的年龄参数： " + DataUtils.formatRequestParamAge(age, birthday));
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("age", DataUtils.formatRequestParamAge(age, birthday));
        paramMap.put("sex", sex + "");
        paramMap.put("profession", profession + "");
        paramMap.put("mainProductId", mainProposalID + "");
        paramMap.put("page", pageIndex + "");
        paramMap.put("pageSize", pageSize);
        return paramMap;
    }
}
